package com.df.excel_export.project_config;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;


/**
 * 项目：
 *      组：
 *          c(客户都安):
 *          s(服务端):
 */
@Data
public class ProjectConfig {
    @NotEmpty
    private String name;
    @NotEmpty
    private String excel_path;
    private String enum_path;//枚举文件名
    private String table_prefix = "";
    private String table_suffix = "";
    private List<ProjectGroupConfig> groups = new ArrayList<ProjectGroupConfig>();

    public ProjectGroupConfig getGroup(String groupName) {
        for (ProjectGroupConfig group : groups) {
            if(group.getEnName().equals(groupName)) {
                return group;
            }
        }
        return null;
    }
}
